package com.animal.service.impl;

import com.animal.entity.pojo.AGoodsy;
import com.animal.mapper.GoodsyMapper;
import com.animal.service.GoodsyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsyServiceImpl implements GoodsyService {
    @Autowired
    private GoodsyMapper goodsyMapper;


    @Override
    public List<AGoodsy> getAGoodsyByuserid(Integer userid) {
        return goodsyMapper.getAGoodsyByuserid(userid);
    }

    @Override
    public List<AGoodsy> getAGoodsyAll() {
        return goodsyMapper.getAGoodsyAll();
    }

    @Override
    public boolean updateSalvageamountById(Integer id, Integer salvageamount) {
        int count = goodsyMapper.updateSalvageamountById(id, salvageamount);
        if (count > 0) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public AGoodsy getAGoodsyByid(Integer id) {
        return goodsyMapper.getAGoodsyByid(id);
    }
}
